package edu.cuit.avatar.common.converter;


import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.Date;

/**
 * 将源类型java.util.Date转换为LocalDateTime
 * @author <a href="mailto:1020zhaodan@163.com">Adan</a>
 * @version 1.0
 * @date 2025/7/26 10:29
 */
public class LocalDateTimeConverter implements Converter<Date, LocalDateTime> {
    @Override
    public LocalDateTime convert(Date value) {
        if(value == null) return null;
        return LocalDateTime.ofInstant(value.toInstant(), ZoneId.systemDefault());
    }
}
